<template>
  <div >
    <el-container>
      <el-aside style="background-color: white;height:92.6vh" width="11vw">
        <el-scrollbar>
          <el-menu :default-active="curRoute" @select="handleSelect">
            <el-menu-item v-for="item in menuList" :key="item" :index="item.path" style="border-bottom: 1px solid #c5c5c5;">
              <span>{{item.menu}}</span>
            </el-menu-item>
          </el-menu>
        </el-scrollbar>
      </el-aside>
      <el-main>
        <router-view/>
      </el-main>
    </el-container>
  </div>
</template>

<script setup>

import {onMounted, ref} from "vue";
import request from "@/utils/request";
import {store} from "@/store";
import router from "@/router";

const curMenu=ref("首页")
const curRoute=ref(router.currentRoute.value.path)
const menuList=[
  {
    menu:"首页",
    path:"/business/Income"
  },
  {
    menu:"收入对账",
    path:"/inventory/Reconcile"
  },
  {
    menu:"销售流水",
    path:"/inventory/SalesFlow"
  },
  {
    menu:"生意分析",
    path:"/inventory/AnalysisReport"
  },
  {
    menu:"推荐选品",
    path:"/inventory/BigDataSelection"
  },
  {
    menu:"顾客分析",
    path:"/inventory/CustomerAnalysis"
  },
  {
    menu:"销售排行",
    path:"/inventory/SalesRank"
  },
  {
    menu:"调价建议",
    path:"/inventory/PriceAdjustSuggest"
  },
]
onMounted(()=>{

})

const handleSelect = (key) => {
  router.push(key)
}

</script>

<style scoped>
.el-menu-item.is-active {
  color: rgb(46, 126, 226) !important;
  font-weight: bold;
  border-right: 2px solid rgb(47, 125, 223);
}

</style>